import java.util.Scanner;

public class Practice2 {
    /*
    链接https://ac.nowcoder.com/acm/contest/98241/B
    找出最大最小值, 然后模拟一下, 1100ms, 可以用快读模板容易超时
     */
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        for(int i = 0;i < n;i++){
            int cur = in.nextInt();
            max = Math.max(max,cur);
            min = Math.min(min,cur);
        }
        int ret1 = max - min;
        int ret2 = ((max + min) % 2 == 0) ? (max + min) / 2 : (max + min) / 2 + 1;
        System.out.println(ret1 + " " + ret2);
    }
}
